package com.yuanfeng.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanfeng.commoms.vo.goods.ManageGoodsPropertyAddVO;
import com.yuanfeng.commoms.vo.goods.ManagePropertyValueVO;
import com.yuanfeng.commoms.vo.goods.ManageSpecNameVO;
import com.yuanfeng.commoms.vo.goods.ManageTransportTemplateResultVO;
import com.yuanfeng.commoms.vo.shop.ManageShopSelfCatMenuVO;
import com.yuanfeng.goods.dto.ManageByTypeIdParamInfoDTO;
import com.yuanfeng.goods.entity.GoodsPropertyEntity;
import com.yuanfeng.goods.vo.GdbMerchantGoodsSpecPitchVO;
import com.yuanfeng.goods.vo.ManageSpecValueResultVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Entity com.yuanfeng.goods.entity.GoodsProperty
 */
@Mapper
public interface GoodsPropertyMapper extends BaseMapper<GoodsPropertyEntity> {

    /**
     * 新增商品属性
     * @param param
     */
    void insertGoodsProperty(@Param("param") Map<String, Object> param);

    /**
     * 修改商品属性
     * @param param
     */
    void updateGoodsProperty(@Param("param")Map<String, Object> param);


    List<ManageGoodsPropertyAddVO> selectByCommonId(@Param("commonId")Integer commonId);


    /**
     * 根据typeId查询属性名
     *
     * @param typeId
     * @return
     */
    List<ManagePropertyValueVO> selectByTypeId2(@Param("typeId") Integer typeId);

    /**
     * 根据goodsid查询商品规格
     * @param goodsId
     * @return
     */
    Map selShopIdBygoodsId(@Param("goodsId")String goodsId);

    /**
     * 根据typeId查询属性名
     * @param typeId
     * @return
     */
    List<ManageSpecNameVO> selectByTypeId(@Param("typeId")Integer typeId);

    /**
     * 查询商品规格列表
     * @param param
     * @return
     */
    List<ManageSpecValueResultVO> selectByResultParam(@Param("param") ManageByTypeIdParamInfoDTO param);

    /**
     * 查询指定规格列表
     * @param param
     * @return
     */
    List<ManageSpecValueResultVO> selectByResultParam2(@Param("param") ManageByTypeIdParamInfoDTO param);

    /**
     * 查询商品规格信息
     * @param goodsId
     * @return
     */
    GdbMerchantGoodsSpecPitchVO selectGoodsSpecPitch(@Param("goodsId")String goodsId);

    /**
     * 查询运费模板
     * @param shopId
     * @return
     */
    List<ManageTransportTemplateResultVO> selectByShopId(@Param("shopId")Integer shopId);

    /**
     * 获取所有的分类
     * @param shopId
     * @return
     */
    List<ManageShopSelfCatMenuVO> selectByShopIdCat(Integer shopId);

}




